<?php

class IndexController extends Zend_Controller_Action
{
    private $group;
    
    public function indexAction() 
    {
        $group = $this->getGroup();
        $this->view->groups = $group->getLast(5);
    }

    protected function getGroup()
    {
        if (null === $this->group) {
            require_once APPLICATION_PATH . '/models/Group.php';
            $this->group = new Model_Group();
        }
        return $this->group;
    }
}
